'use strict';
/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller, middleware } = app;

  // 用户
  router.post('/api/upload/file', controller.uploadcos.file);
  // 登录
  router.get('/api/user/list', controller.user.allList);
  router.post('/api/user/login', controller.user.login);
  // 注册
  router.post('/api/user/register', controller.user.create);
  router.resources('user', '/api/user', controller.user);
  // 分类
    router.get('/api/category/list', controller.category.allList);
    router.resources('category', '/api/category', controller.category);
    // 商品
    router.get('/api/product/list', controller.product.allList);
    router.resources('product', '/api/product', controller.product);
    // 配置
    router.get('/api/config/list', controller.config.allList);
    router.resources('config', '/api/config', controller.config);

  router.get("/api/weixin/wxConfig", controller.wx.wxConfig);
};
